<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Admin/Views/Shared/Admin.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<Smiley>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <fieldset>
        <legend><%= Html.ThemeImage("smiley_cool.png") %> Smilies</legend>
        
        <% using(Html.BeginForm()){ %>
            <fieldset>
                <legend>Create Smiley</legend>
                
                <dl class="form">
                
                    <dt>Smiley Image</dt>
                    <dd>
                        <%= Html.TextBox("ImageURL") %>
                        <%= Html.ValidationMessage("ImageURL") %>
                        <label>Name of smiley image located in the "Images/Smilies" folder</label>
                    </dd>
                    
                    <dt>Code</dt>
                    <dd>
                        <%= Html.TextBox("Code") %>
                        <%= Html.ValidationMessage("Code") %>
                    </dd>
                    
                    <dt>Title</dt>
                    <dd>
                        <%= Html.TextBox("Title") %>
                    </dd>
                    
                    <dt>&nbsp;</dt>
                    <dd>
                        <%= Html.SubmitButton("CreateSmiley", "Create Smiley") %>
                    </dd>
                    
                </dl>
                
            </fieldset>
        
        <% } %>    
        
        <table class="form_table">
            
            <tr>
                <th>Image</th>
                <th>Code</th>
                <th>Title</th>
                <th></th>
                <th></th>
            </tr>    
                
            <% foreach(Smiley s in Model){ %>
                <tr>
                    <td><%= Html.Image("~/Images/Smilies/"+s.ImageURL) %></td>
                    <td><%= s.Code %></td>
                    <td><%= s.Title %></td>
                    <td><%= Html.ActionLink("Edit", "EditSmiley", new { SmileyID = s.SmileyID })%></td>
                    <td><%= Html.AdminConfirm("Delete", Url.Action("DeleteSmiley", new { SmileyID = s.SmileyID }), Url.Action("Smilies")) %></td>
                </tr>
            <%} %>
        
        </table>
        
    </fieldset>

</asp:Content>
